import React, { Component } from 'react'
import styles from './index.module.scss'
import {withRouter} from 'react-router-dom'

class HomeHeader extends Component {
  render() {
    return (
      <div className={[styles.homeHeaderBox, this.props.className ? styles[this.props.className] : ''].join(' ')}>
        <div className={styles.leftBox}>
          <div className={styles.cityName}>
            {this.props.localCity}
            <i className="iconfont icon-arrow"></i>
          </div>
          <div className={styles.form}>
            <i className="iconfont icon-seach"></i>
            <span>请输入小区或地址</span>
          </div>
        </div>
        <i className={['iconfont', 'icon-map', styles.rightIcon].join(' ')} onClick={() =>this.props.history.push('/map')} />
      </div>
    )
  }
}

export default withRouter(HomeHeader)
